YES 1.36 H-Termination proof of /home/matraf/haskell/eval_FullyBlown_Fast/List.hs
H-Termination of the given Haskell-Program with start terms could successfully be proven:



HASKELL
  ↳ IFR

mainModule List
  ((unionBy :: (a  ->  a  ->  Bool ->  [a ->  [a ->  [a]) :: (a  ->  a  ->  Bool ->  [a ->  [a ->  [a])

module List where
  import qualified Maybe
import qualified Prelude

  deleteBy :: (a  ->  a  ->  Bool ->  a  ->  [a ->  [a]
deleteBy _ _ [] []
deleteBy eq x (y : ys if x `eq` y then ys else y : deleteBy eq x ys

  elem_by :: (a  ->  a  ->  Bool ->  a  ->  [a ->  Bool
elem_by _ _ [] False
elem_by eq y (x : xsx `eq` y || elem_by eq y xs

  nubBy :: (a  ->  a  ->  Bool ->  [a ->  [a]
nubBy eq l 
nubBy' l [] where 
nubBy' [] _ []
nubBy' (y : ysxs 
 | elem_by eq y xs = 
nubBy' ys xs
 | otherwise = 
y : nubBy' ys (y : xs)

  unionBy :: (a  ->  a  ->  Bool ->  [a ->  [a ->  [a]
unionBy eq xs ys xs ++ foldl (flip (deleteBy eq)) (nubBy eq ys) xs


module Maybe where
  import qualified List
import qualified Prelude



If Reductions:
The following If expression
if eq x y then ys else y : deleteBy eq x ys

is transformed to
deleteBy0 ys y eq x True = ys
deleteBy0 ys y eq x False = y : deleteBy eq x ys



↳ HASKELL
  ↳ IFR
HASKELL
      ↳ BR

mainModule List
  ((unionBy :: (a  ->  a  ->  Bool ->  [a ->  [a ->  [a]) :: (a  ->  a  ->  Bool ->  [a ->  [a ->  [a])

module List where
  import qualified Maybe
import qualified Prelude

  deleteBy :: (a  ->  a  ->  Bool ->  a  ->  [a ->  [a]
deleteBy _ _ [] []
deleteBy eq x (y : ysdeleteBy0 ys y eq x (x `eq` y)

  
deleteBy0 ys y eq x True ys
deleteBy0 ys y eq x False y : deleteBy eq x ys

  elem_by :: (a  ->  a  ->  Bool ->  a  ->  [a ->  Bool
elem_by _ _ [] False
elem_by eq y (x : xsx `eq` y || elem_by eq y xs

  nubBy :: (a  ->  a  ->  Bool ->  [a ->  [a]
nubBy eq l 
nubBy' l [] where 
nubBy' [] _ []
nubBy' (y : ysxs 
 | elem_by eq y xs = 
nubBy' ys xs
 | otherwise = 
y : nubBy' ys (y : xs)

  unionBy :: (a  ->  a  ->  Bool ->  [a ->  [a ->  [a]
unionBy eq xs ys xs ++ foldl (flip (deleteBy eq)) (nubBy eq ys) xs


module Maybe where
  import qualified List
import qualified Prelude



Replaced joker patterns by fresh variables and removed binding patterns.

↳ HASKELL
  ↳ IFR
    ↳ HASKELL
      ↳ BR
HASKELL
          ↳ COR

mainModule List
  ((unionBy :: (a  ->  a  ->  Bool ->  [a ->  [a ->  [a]) :: (a  ->  a  ->  Bool ->  [a ->  [a ->  [a])

module List where
  import qualified Maybe
import qualified Prelude

  deleteBy :: (a  ->  a  ->  Bool ->  a  ->  [a ->  [a]
deleteBy vw vx [] []
deleteBy eq x (y : ysdeleteBy0 ys y eq x (x `eq` y)

  
deleteBy0 ys y eq x True ys
deleteBy0 ys y eq x False y : deleteBy eq x ys

  elem_by :: (a  ->  a  ->  Bool ->  a  ->  [a ->  Bool
elem_by vz wu [] False
elem_by eq y (x : xsx `eq` y || elem_by eq y xs

  nubBy :: (a  ->  a  ->  Bool ->  [a ->  [a]
nubBy eq l 
nubBy' l [] where 
nubBy' [] vy []
nubBy' (y : ysxs 
 | elem_by eq y xs = 
nubBy' ys xs
 | otherwise = 
y : nubBy' ys (y : xs)

  unionBy :: (a  ->  a  ->  Bool ->  [a ->  [a ->  [a]
unionBy eq xs ys xs ++ foldl (flip (deleteBy eq)) (nubBy eq ys) xs


module Maybe where
  import qualified List
import qualified Prelude



Cond Reductions:
The following Function with conditions
nubBy' [] vy = []
nubBy' (y : ysxs
 | elem_by eq y xs
 = nubBy' ys xs
 | otherwise
 = y : nubBy' ys (y : xs)

is transformed to
nubBy' [] vy = nubBy'3 [] vy
nubBy' (y : ysxs = nubBy'2 (y : ysxs

nubBy'1 y ys xs True = nubBy' ys xs
nubBy'1 y ys xs False = nubBy'0 y ys xs otherwise

nubBy'0 y ys xs True = y : nubBy' ys (y : xs)

nubBy'2 (y : ysxs = nubBy'1 y ys xs (elem_by eq y xs)

nubBy'3 [] vy = []
nubBy'3 wz xu = nubBy'2 wz xu

The following Function with conditions
undefined 
 | False
 = undefined

is transformed to
undefined  = undefined1

undefined0 True = undefined

undefined1  = undefined0 False



↳ HASKELL
  ↳ IFR
    ↳ HASKELL
      ↳ BR
        ↳ HASKELL
          ↳ COR
HASKELL
              ↳ LetRed

mainModule List
  ((unionBy :: (a  ->  a  ->  Bool ->  [a ->  [a ->  [a]) :: (a  ->  a  ->  Bool ->  [a ->  [a ->  [a])

module List where
  import qualified Maybe
import qualified Prelude

  deleteBy :: (a  ->  a  ->  Bool ->  a  ->  [a ->  [a]
deleteBy vw vx [] []
deleteBy eq x (y : ysdeleteBy0 ys y eq x (x `eq` y)

  
deleteBy0 ys y eq x True ys
deleteBy0 ys y eq x False y : deleteBy eq x ys

  elem_by :: (a  ->  a  ->  Bool ->  a  ->  [a ->  Bool
elem_by vz wu [] False
elem_by eq y (x : xsx `eq` y || elem_by eq y xs

  nubBy :: (a  ->  a  ->  Bool ->  [a ->  [a]
nubBy eq l 
nubBy' l [] where 
nubBy' [] vy nubBy'3 [] vy
nubBy' (y : ysxs nubBy'2 (y : ys) xs
nubBy'0 y ys xs True y : nubBy' ys (y : xs)
nubBy'1 y ys xs True nubBy' ys xs
nubBy'1 y ys xs False nubBy'0 y ys xs otherwise
nubBy'2 (y : ysxs nubBy'1 y ys xs (elem_by eq y xs)
nubBy'3 [] vy []
nubBy'3 wz xu nubBy'2 wz xu

  unionBy :: (a  ->  a  ->  Bool ->  [a ->  [a ->  [a]
unionBy eq xs ys xs ++ foldl (flip (deleteBy eq)) (nubBy eq ys) xs


module Maybe where
  import qualified List
import qualified Prelude



Let/Where Reductions:
The bindings of the following Let/Where expression
nubBy' l []
where 
nubBy' [] vy = nubBy'3 [] vy
nubBy' (y : ysxs = nubBy'2 (y : ysxs
nubBy'0 y ys xs True = y : nubBy' ys (y : xs)
nubBy'1 y ys xs True = nubBy' ys xs
nubBy'1 y ys xs False = nubBy'0 y ys xs otherwise
nubBy'2 (y : ysxs = nubBy'1 y ys xs (elem_by eq y xs)
nubBy'3 [] vy = []
nubBy'3 wz xu = nubBy'2 wz xu

are unpacked to the following functions on top level
nubByNubBy'3 xv [] vy = []
nubByNubBy'3 xv wz xu = nubByNubBy'2 xv wz xu

nubByNubBy'2 xv (y : ysxs = nubByNubBy'1 xv y ys xs (elem_by xv y xs)

nubByNubBy'0 xv y ys xs True = y : nubByNubBy' xv ys (y : xs)

nubByNubBy'1 xv y ys xs True = nubByNubBy' xv ys xs
nubByNubBy'1 xv y ys xs False = nubByNubBy'0 xv y ys xs otherwise

nubByNubBy' xv [] vy = nubByNubBy'3 xv [] vy
nubByNubBy' xv (y : ysxs = nubByNubBy'2 xv (y : ysxs



↳ HASKELL
  ↳ IFR
    ↳ HASKELL
      ↳ BR
        ↳ HASKELL
          ↳ COR
            ↳ HASKELL
              ↳ LetRed
HASKELL
                  ↳ Narrow

mainModule List
  (unionBy :: (a  ->  a  ->  Bool ->  [a ->  [a ->  [a])

module List where
  import qualified Maybe
import qualified Prelude

  deleteBy :: (a  ->  a  ->  Bool ->  a  ->  [a ->  [a]
deleteBy vw vx [] []
deleteBy eq x (y : ysdeleteBy0 ys y eq x (x `eq` y)

  
deleteBy0 ys y eq x True ys
deleteBy0 ys y eq x False y : deleteBy eq x ys

  elem_by :: (a  ->  a  ->  Bool ->  a  ->  [a ->  Bool
elem_by vz wu [] False
elem_by eq y (x : xsx `eq` y || elem_by eq y xs

  nubBy :: (a  ->  a  ->  Bool ->  [a ->  [a]
nubBy eq l nubByNubBy' eq l []

  
nubByNubBy' xv [] vy nubByNubBy'3 xv [] vy
nubByNubBy' xv (y : ysxs nubByNubBy'2 xv (y : ys) xs

  
nubByNubBy'0 xv y ys xs True y : nubByNubBy' xv ys (y : xs)

  
nubByNubBy'1 xv y ys xs True nubByNubBy' xv ys xs
nubByNubBy'1 xv y ys xs False nubByNubBy'0 xv y ys xs otherwise

  
nubByNubBy'2 xv (y : ysxs nubByNubBy'1 xv y ys xs (elem_by xv y xs)

  
nubByNubBy'3 xv [] vy []
nubByNubBy'3 xv wz xu nubByNubBy'2 xv wz xu

  unionBy :: (a  ->  a  ->  Bool ->  [a ->  [a ->  [a]
unionBy eq xs ys xs ++ foldl (flip (deleteBy eq)) (nubBy eq ys) xs


module Maybe where
  import qualified List
import qualified Prelude



Haskell To QDPs


↳ HASKELL
  ↳ IFR
    ↳ HASKELL
      ↳ BR
        ↳ HASKELL
          ↳ COR
            ↳ HASKELL
              ↳ LetRed
                ↳ HASKELL
                  ↳ Narrow
                    ↳ AND
QDP
                        ↳ DependencyGraphProof
                      ↳ QDP
                      ↳ QDP
                      ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

new_nubByNubBy'(xw48, :(xw500, xw501), xw51, xw52, ba) → new_nubByNubBy'1(xw48, xw500, xw501, xw51, xw52, :(xw51, xw52), ba)
new_nubByNubBy'1(xw48, xw49, xw50, xw51, xw52, :(xw540, xw541), ba) → new_nubByNubBy'10(xw48, xw49, xw50, xw51, xw52, xw541, ba)
new_nubByNubBy'10(xw48, xw49, :(xw500, xw501), xw51, xw52, xw54, ba) → new_nubByNubBy'1(xw48, xw500, xw501, xw51, xw52, :(xw51, xw52), ba)
new_nubByNubBy'1(xw48, xw49, xw50, xw51, xw52, [], ba) → new_nubByNubBy'(xw48, xw50, xw49, :(xw51, xw52), ba)
new_nubByNubBy'10(xw48, xw49, xw50, xw51, xw52, :(xw540, xw541), ba) → new_nubByNubBy'10(xw48, xw49, xw50, xw51, xw52, xw541, ba)
new_nubByNubBy'10(xw48, xw49, xw50, xw51, xw52, [], ba) → new_nubByNubBy'(xw48, xw50, xw49, :(xw51, xw52), ba)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ HASKELL
  ↳ IFR
    ↳ HASKELL
      ↳ BR
        ↳ HASKELL
          ↳ COR
            ↳ HASKELL
              ↳ LetRed
                ↳ HASKELL
                  ↳ Narrow
                    ↳ AND
                      ↳ QDP
                        ↳ DependencyGraphProof
QDP
                            ↳ QDPSizeChangeProof
                      ↳ QDP
                      ↳ QDP
                      ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

new_nubByNubBy'(xw48, :(xw500, xw501), xw51, xw52, ba) → new_nubByNubBy'1(xw48, xw500, xw501, xw51, xw52, :(xw51, xw52), ba)
new_nubByNubBy'1(xw48, xw49, xw50, xw51, xw52, :(xw540, xw541), ba) → new_nubByNubBy'10(xw48, xw49, xw50, xw51, xw52, xw541, ba)
new_nubByNubBy'10(xw48, xw49, :(xw500, xw501), xw51, xw52, xw54, ba) → new_nubByNubBy'1(xw48, xw500, xw501, xw51, xw52, :(xw51, xw52), ba)
new_nubByNubBy'10(xw48, xw49, xw50, xw51, xw52, :(xw540, xw541), ba) → new_nubByNubBy'10(xw48, xw49, xw50, xw51, xw52, xw541, ba)
new_nubByNubBy'10(xw48, xw49, xw50, xw51, xw52, [], ba) → new_nubByNubBy'(xw48, xw50, xw49, :(xw51, xw52), ba)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ HASKELL
  ↳ IFR
    ↳ HASKELL
      ↳ BR
        ↳ HASKELL
          ↳ COR
            ↳ HASKELL
              ↳ LetRed
                ↳ HASKELL
                  ↳ Narrow
                    ↳ AND
                      ↳ QDP
QDP
                        ↳ QDPSizeChangeProof
                      ↳ QDP
                      ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

new_deleteBy0(xw181, xw180, xw3, xw4110, ba) → new_deleteBy(xw3, xw4110, xw181, ba)
new_deleteBy(xw3, xw4110, :(xw180, xw181), ba) → new_deleteBy0(xw181, xw180, xw3, xw4110, ba)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ HASKELL
  ↳ IFR
    ↳ HASKELL
      ↳ BR
        ↳ HASKELL
          ↳ COR
            ↳ HASKELL
              ↳ LetRed
                ↳ HASKELL
                  ↳ Narrow
                    ↳ AND
                      ↳ QDP
                      ↳ QDP
QDP
                        ↳ QDPSizeChangeProof
                      ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

new_foldl(xw3, :(xw4110, xw4111), ba) → new_foldl(xw3, xw4111, ba)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ HASKELL
  ↳ IFR
    ↳ HASKELL
      ↳ BR
        ↳ HASKELL
          ↳ COR
            ↳ HASKELL
              ↳ LetRed
                ↳ HASKELL
                  ↳ Narrow
                    ↳ AND
                      ↳ QDP
                      ↳ QDP
                      ↳ QDP
QDP
                        ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

new_psPs(:(xw411111110, xw411111111), xw15, ba) → new_psPs(xw411111111, xw15, ba)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: